Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

opt(operator-v2): Resolve BR todos #6086

Merged
merged 16 commits into from
Feb 20, 2025

Conversation

ideascf
Copy link
Contributor

@ideascf ideascf commented Feb 20, 2025

What problem does this PR solve?

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


@ti-chi-bot ti-chi-bot bot requested a review from howardlau1999 February 20, 2025 07:35
@github-actions github-actions bot added the v2 for operator v2 label Feb 20, 2025
Copy link

/run-pull-e2e-kind-v2

@ti-chi-bot ti-chi-bot bot added the size/XXL label Feb 20, 2025
Comment on lines -298 to -301
// TikvGCLifeTime is to specify the safe gc life time for backup.
// The time limit during which data is retained for each GC, in the format of Go Duration.
// When a GC happens, the current time minus this value is the safe point.
TikvGCLifeTime *string `json:"tikvGCLifeTime,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TikvGCLifeTime is only used when using dumpling mode as pseudo backup and only is required for tikv < v4.0.8.

Comment on lines -139 to -142
// TikvGCLifeTime is to specify the safe gc life time for restore.
// The time limit during which data is retained for each GC, in the format of Go Duration.
// When a GC happens, the current time minus this value is the safe point.
TikvGCLifeTime *string `json:"tikvGCLifeTime,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -90,7 +90,6 @@ const (
DirPathClusterTLSPD = "/var/lib/pd-tls"
DirPathClusterTLSTiKV = "/var/lib/tikv-tls"
DirPathClusterTLSTiDB = "/var/lib/tidb-tls"
DirPathTiDBClientTLS = "/var/lib/tidb-client-tls" // FIXME(ideascf): do we need this?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need do tidb SQL client TLS

Comment on lines +39 to +40
// PDAddress is the address of the PD, for example: db-pd.tidb12345:2379
PDAddress string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we can configure PD port for pd groups, so we need pass the PD address (with the port) to the backup-manager.

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 233 lines in your changes missing coverage. Please review.

Project coverage is 54.61%. Comparing base (24fc7b3) to head (ea3036f).

Additional details and impacted files
@@              Coverage Diff               @@
##           feature/v2    #6086      +/-   ##
==============================================
- Coverage       54.88%   54.61%   -0.27%     
==============================================
  Files             221      223       +2     
  Lines           15135    15284     +149     
==============================================
+ Hits             8307     8348      +41     
- Misses           6828     6936     +108     
Flag Coverage Δ
unittest 54.61% <0.00%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

}

// nolint: gocyclo
func (bm *Manager) performBackup(ctx context.Context, backup *v1alpha1.Backup, db *sql.DB) error {
Copy link
Contributor Author

@ideascf ideascf Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backup.spec.from is deprecated and only used for old versions of tikv and not supported for tikv >v6.5.1

Copy link

/run-pull-e2e-kind-v2

)

// set tikv gc life time to prevent gc when backing up data
if db != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -269,33 +170,6 @@ func (bm *Manager) performBackup(ctx context.Context, backup *v1alpha1.Backup, d

// run br binary to do the real job
backupErr := bm.backupData(ctx, backup)

if db != nil && oldTikvGCTimeDuration < tikvGCTimeDuration {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -50,6 +50,8 @@ type Options struct {
TargetAZ string
// UseFSR to indicate if use FSR for TiKV data volumes during EBS snapshot restore
UseFSR bool
// PDAddress is the address of the PD, for example: db-pd.tidb12345:2379
PDAddress string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines +43 to +45
// if it's gone just return
task.IfBreak(common.CondJobHasBeenDeleted(state)),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to remove finalizer before we break the runner.

@ti-chi-bot ti-chi-bot bot removed the lgtm label Feb 20, 2025
Copy link

/run-pull-e2e-kind-v2

Copy link
Contributor

ti-chi-bot bot commented Feb 20, 2025

@ideascf: Your PR was out of date, I have automatically updated it for you.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Copy link

/run-pull-e2e-kind-v2

Copy link

/run-pull-e2e-kind-v2

1 similar comment
@fgksgf
Copy link
Member

fgksgf commented Feb 20, 2025

/run-pull-e2e-kind-v2

@fgksgf
Copy link
Member

fgksgf commented Feb 20, 2025

/lgtm

@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 20, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fgksgf

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Feb 20, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-20 07:58:16.10545075 +0000 UTC m=+1120938.501672797: ☑️ agreed by fgksgf.
  • 2025-02-20 08:00:52.724855538 +0000 UTC m=+1121095.121077600: ✖️🔁 reset by ideascf.
  • 2025-02-20 10:12:44.324946876 +0000 UTC m=+1129006.721168938: ☑️ agreed by fgksgf.

@ti-chi-bot ti-chi-bot bot merged commit 3e364c3 into pingcap:feature/v2 Feb 20, 2025
9 checks passed
@ideascf ideascf deleted the resolve-br-todo branch February 20, 2025 10:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants